#!/usr/bin/env python
# --*-- conding:utf-8 --*--
# @Time : 2024/1/27
# @Author : liangpp
# @Email : mobaicloud@163.com
# @Software : PyCharm


from carlargescreen.models import CarInfo


def get_bottomleft():
    allcars = list(CarInfo.objects.all())
    carname_list = []
    carcount_list = []
    caravgprice_list = []
    for c in allcars:
        carname_list.append(c.car_name)
        carcount_list.append(int(c.count))
        list_price = c.price.split("-")
        c_avg_price = round((float(list_price[0]) + float(list_price[1])) / 2, 2)
        caravgprice_list.append(c_avg_price)
    # print(len(carname_list), carname_list[:3])
    # print(len(carcount_list), carcount_list[:3])
    # print(len(caravgprice_list), caravgprice_list[:3])
    return carname_list, carcount_list, caravgprice_list